package com.yuanchu.order.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.yuanchu.order.entity.YoshopCommentEntity;
import com.yuanchu.order.entity.YoshopCommentImageEntity;
import com.yuanchu.order.entity.YoshopUploadFileEntity;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @version: 1.0
 * @Author: adan
 * @description:
 * @date: 2024-02-27 16:39
 */
@Data
public class CommentImageDto extends YoshopCommentEntity {

    /**
     * 图片ID
     */
    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("imageIds")
    private List<Integer> imageIds;

    /**
     * 图片列表
     */
    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("imageList")
    private List<YoshopUploadFileEntity> imageList;

    /**
     * 评价图片列表
     */
    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("images")
    private List<YoshopCommentImageEntity> images;


    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("orderGoods")
    private OrderGoods orderGoods;

    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private CommentUser user;

    @Data
    public static class OrderGoods implements Serializable {
        @JsonProperty("order_goods_id")
        private int orderGoodsId;
        @JsonProperty("goods_id")
        private int goodsId;
        @JsonProperty("goods_name")
        private String goodsName;
        @JsonProperty("image_id")
        private int imageId;
        @JsonProperty("order_id")
        private int orderId;
        @JsonProperty("goods_image")
        private String goodsImage;
        @JsonProperty("goods_props")
        private Object goodsProps;
    }

    @Data
    public static class CommentUser {
        @JsonProperty("user_id")
        private int userId;
        @JsonProperty("nick_name")
        private String nickName;
        @JsonProperty("avatar_id")
        private int avatarId;
        @JsonProperty("avatar_url")
        private String avatarUrl;
    }
}
